import { createRouter, createWebHistory } from "vue-router"
import HomeView from "../views/home/index.vue"
import MainLayout from "../layout/index.vue"

const router = createRouter({
  history: createWebHistory(),
  routes: [
    { path: "/", redirect: "/home" },
    {
      path: "/", // 修改为根路径
      component: MainLayout,
      children: [
        {
          path: "home",
          name: "home",
          meta: { title: "总体概览" },
          component: HomeView
        },
        {
          path: "major-explorer",
          name: "major-explorer",
          meta: { title: "专业探索" },
          component: () => import("../views/major-explorer/index.vue")
        },
        {
          path: "university-explorer",
          name: "university-explorer",
          meta: { title: "高校探索" },
          component: () => import("../views/university-explorer/index.vue")
        }
      ]
    }
  ]
})

export default router
